home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tcplusx.zip / EVENT.H < prev    next >
C/C++ Source or Header  |  1991-02-24  |  3KB  |  139 lines

  1. #ifndef _EVENT_H
  2. #define _EVENT_H
  3.  
  4. //
  5. // event.h        - header file for class Event
  6. // Author        - Robin W. McKean
  7. // Last Update    - February 17,1991
  8. // Copyright (C) 1991 All rights reserved
  9. //
  10. // This file remains the property of the author, Robin W. McKean.  You are
  11. // free to use and change it as you see fit.  This module, nor its object
  12. // code, may not however be included  in any packaged software without the
  13. // written consent of the author.
  14. //
  15.  
  16. // Contents ----------------------------------------------------------------
  17. //
  18. //        eventClass
  19. //        Event
  20. //
  21. // Description
  22. //
  23. //        Defines the class Event.  The purpose of this class is to provide
  24. //        a uniform method of passing input information to the program.
  25. //
  26. // End ---------------------------------------------------------------------
  27.  
  28. // Interface Dependencies ---------------------------------------------------
  29.  
  30. #ifndef _IOSTREAM_H
  31. #include <iostream.h>
  32. #endif
  33.  
  34. #ifndef _GEN_H
  35. #include <gen.h>
  36. #endif
  37.  
  38. #ifndef _USETYPES_H
  39. #include <usetypes.h>
  40. #endif
  41.  
  42. #ifndef _OBJECT_H
  43. #include <object.h>
  44. #endif
  45.  
  46. // End Interface Dependencies ------------------------------------------------
  47.  
  48. // Class //
  49.  
  50. class Event : public Object
  51. {
  52. public:
  53.     Event( void ) {}
  54.     Event( Event& );
  55.     ~Event( void ) {}
  56.  
  57.     virtual classType        isA( ) const;
  58.     virtual char            *nameOf() const;
  59.     virtual hashValueType    hashValue( ) const;
  60.     virtual int             isEqual( const Object& ) const;
  61.     virtual void            printOn( ostream& ) const;
  62.  
  63.     unsigned int            type;
  64.     unsigned int            typeCode;
  65.     unsigned int            shiftState;
  66.     Point                    point;
  67.     Sector                    sector;
  68. };
  69.  
  70. // Description --------------------------------------------------------------
  71. //
  72. //        Defines the event class that will be used to pass information to
  73. //        objects in the library.  In this way, mouse and keyboard events can
  74. //        be sent to objects in a uniform manner
  75. //
  76. //    Constructor
  77. //
  78. //        Event()
  79. //
  80. //        Really serves no purpose, other than to initialize the event
  81. //
  82. //        Event( Event& )
  83. //
  84. //        Copy constructor, copies one event into another
  85. //
  86. //    Destructor
  87. //
  88. //        ~Event()
  89. //
  90. //        Really serves no purpose, required by compiler
  91. //
  92. //    Member Functions
  93. //
  94. //        isA( )
  95. //
  96. //        Returns character class type eventClass
  97. //
  98. //        nameOf( )
  99. //
  100. //        Returns a character representation of class, "Event"
  101. //
  102. //        hashValue( )
  103. //
  104. //        This event has no hash value, so it returns 0
  105. //
  106. //        isEqual( const Object& )
  107. //
  108. //        Determines if one event is equal to another
  109. //
  110. //        printOn( ostream& )
  111. //
  112. //        Prints the contents of the class in a logical fashion
  113. //
  114. //    Inherited Members
  115. //
  116. //        isSortable( )        inherited from Object
  117. //        isAssociation( )    inherited from Object
  118. //        operator new        inherited from Object
  119. //        firstThat( )        inherited from Object
  120. //        lastThat( )         inherited from Object
  121. //
  122. //    Member Variables
  123. //
  124. //        type
  125. //
  126. //        Type of the event
  127. //
  128. //        typeCode
  129. //
  130. //        Code for this event
  131. //
  132. //        shiftState
  133. //
  134. //        State of the shift keys, if applicable for this event
  135. //
  136. // End Description ----------------------------------------------------------
  137.  
  138. #endif    // _EVENT_H //
  139.